{% extends "projects/base.html" %}
{% load i18n %}

{% block title %}{{ project.title }}: Todo: {{ todo_item.item}} {% endblock %}

{% block branding %}
{% trans 'Projects' %}
{% endblock %}

{% block content %}
{% if project %}
        <div class=projectoutline>
		<div class=projecttitle><b>Project: {{ project.title }}</b></div>
		<div class=projectinside>
			{{ project.description }}<br><br>
			<a href='/homebase/{{ project.id }}/'>Back to Project Home</a><br>
			Complete by: {{ project.completiondate }}
		</div>
	</div>
	<div class=projectdescription>
		<div class=projecttitle><b>Completed To Do items</b></div>
		<div class=projectinside>
		<ul>
		{% for todo in project.todo_set.all %}
			{% if todo.completed %}
			<li>{{ todo.item }} <a class=small href='todo/{{ todo.id }}/uncomplete'><img class=noborder alt="(undo item)" title="(undo item)" src="/homebase/media/images/flag_green.png"></a>
			</li>
			{% endif %}
      		  {% endfor %}			
		</ul>
		</div>
	</div>
	<div class=projectdescription>
		<div class=projecttitle><b>Uncompleted To Do items</b></div>
		<div class=projectinside>
		<ul>
		{% for todo in project.todo_set.all %}
			{% if not todo.completed %}
			<li>{{ todo.item }} <a class=small href='todo/{{ todo.id }}/complete'><img class=noborder alt="(item done)" title="(item done)" src="/homebase/media/images/flag_red.png"></a>
			</li>
			{% endif %}
      		  {% endfor %}			
		</ul>
		</div>
	</div>
{% else %}
        <p>No project was available.</p>
{% endif %} 
{% endblock %}

{% block context_box %}
	<a href='complete/'><img alt="Complete project" title="Complete project" src="/homebase/media/images/led_circle_orange.png" width=45 height=45 class=controlpanel></a>&nbsp
	<a href='/homebase/settings/'><img alt="Settings" title="Settings" src="/homebase/media/images/monitor.png" width=45 height=45 class=controlpanel></a>&nbsp
{% endblock %}